//用户投标
function checkAccount(){
	var account = $('#account').val();
      	$('#account').val(account.replace(/[^0-9.]/g,''));
        account = parseFloat(account);
        $("#account_but").removeAttr('disabled');
        $("#account_but").css("background-color","#2ea7e0");
    if(account>l_account){
           $('#account_tip').html('<span class="g7">您最多只能投资'+l_account+'元</span>');
           $("#account_but").attr("disabled", true);
           $("#account_but").css("background-color","#808080");
        }
}
function tender(){
		var dialog;
        var account = parseFloat($('#account').val());
        if(isNaN(account)){
				  dialog = art.dialog({
						lock: true,
						icon: 'error',
						title: '提示',
						content:"请输入投资金额"
						});
               }else if(isLongin=='0'){
				   dialog = art.dialog({
						lock: true,
						title: '提示',
						icon: 'error',
						content:"您还没有登录,请登录后投标",
						ok:function(){
							 window.location.href="/public/login.html";
						}
					});         
	  }else if(isLongin=='1' && account !=parseFloat(use_money)){
		  dialog = art.dialog({lock: true,icon: 'error',title: '提示',content:"您只能投资"+parseFloat(use_money)+"元"});
	  }else{
		$('#account_but').attr("disabled",true);
		$('#account_but').val('正在提交中。。。');
		$("#account_but").css("background-color","#808080");
	   dialog = art.dialog({
						lock: true,
						title: '提示',
						content:"数据提交中。。。"
						});
		$.ajax({
				type: "POST",
				url: "/loan/e_tender.html",
				data: {money:account,id:borrow_id,experience_id:experience_id},
				success: function(remsg){
		  if(remsg.status==0){
				dialog.content(remsg.info);
				$('#account_but').attr("disabled",false);
				$('#account_but').val('立即投资');
				$("#account_but").css("background-color","#2ea7e0");
			   var temp  = remsg.data;
			   if(temp=='0'){
				   setTimeout(function(){
					   window.location.href="/public/login.html";//没有登录
				   },500);	
			   }
		  }else if(remsg.status==1){
			if(remsg.data=='15'){
				 dialog.content("投标成功");
				window.location.href="/loan/experience/id/"+borrow_id+".html";
			}else 	window.location.href = remsg.info;
		  }
	      
	     }
	}); 
	   }
}